package cmd

import (
	"github.com/spf13/cobra"
	global2 "longmen/server/config/global"
	"longmen/server/internal/services/nami/api/v5/sports/basketball"
	"longmen/server/internal/services/nami/api/v5/sports/football"
	"longmen/server/internal/services/nami/config"
)

var testMatchCli = &cobra.Command{
	Use:   "tm",
	Short: "",
	Long:  "",
	Run: func(cmd *cobra.Command, args []string) {
		ball := basketball.BasketBall{}
		ball.SyncMatchByDate(args[0])
		foot := football.Football{}
		foot.SyncMatchByDate(args[0])
	},
	PreRun: func(cmd *cobra.Command, args []string) {

		global2.Initialize(configFile)
		config.InitConfig()

		err := global2.InitElasticSearch()
		if err != nil {
			global2.Log.Fatalf("%s", err.Error())
		}
	},
	PostRun: func(cmd *cobra.Command, args []string) {

	},
}
